﻿namespace Framework.Base
{    
    /// <summary>
    /// 单例对象
    /// </summary>
    /// <typeparam name="T">对象类型</typeparam>
    public class SignalBaseObject<T> :Base.BaseObject  where T: new()
    {
        private static T m_instance;

        public static T instance
        {
            get
            {
                if (m_instance == null)
                {
                    m_instance = new T();
                }

                return m_instance;
            }
        }

        protected override void OnDestroy()
        {
            m_instance = default(T);
        }
    }
}